package zhongbo.java.air.airflightpath.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.util.Date;
import java.io.Serializable;

/**
 * 飞行轨迹记录表(AirFlightPath)实体类
 *
 * @author makejava
 * @since 2025-04-02 09:45:44
 */

@Data
@TableName("air_flight_path")
@ApiModel("飞行轨迹记录表")
public class AirFlightPath implements Serializable {

    @ApiModelProperty("UUID 主键")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    @NotBlank(message = "关联飞机ICAO码不能为空")
    @Size(min = 6, max = 6, message = "关联飞机ICAO码长度需为6位")
    @ApiModelProperty("关联飞机ICAO码")
    private String icaoCode;

    @NotNull(message = "时间戳不能为空")
    @ApiModelProperty("时间戳")
    @JsonProperty("timestamp")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS", timezone = "GMT+8")
    private Date timestamp;

    @NotNull(message = "纬度不能为空")
    @ApiModelProperty("纬度")
    private Double latitude;

    @NotNull(message = "经度不能为空")
    @ApiModelProperty("经度")
    private Double longitude;

    @NotNull(message = "海拔高度（米）不能为空")
    @ApiModelProperty("海拔高度（米）")
    private Integer altitude;

    @NotNull(message = "地速不能为空")
    @PositiveOrZero(message = "地速不能为负数")
    @ApiModelProperty("地速（公里/小时）")
    private Integer speed;

    @NotNull(message = "航向角不能为空")
    @Min(value = 0, message = "航向角不能小于0")
    @Max(value = 359, message = "航向角不能大于359")
    @ApiModelProperty("航向角（0-359度）")
    private Integer heading;

    @NotNull(message = "数据源类型不能为空")
    @ApiModelProperty("数据源类型（枚举值：ADS_B, RADAR, MLAT）")
    private String sourceType;

}

